/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

package ecarx.eas.notification;


import android.app.PendingIntent;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * FileName: ITyrantAction.java <br>
 * Description : 霸屏通知数据动作事件 <br>
 * Create Time: 2021/8/3 14:07 <br>
 * Update Time: 2021/8/3 14:07 <br>
 *
 * @since 1.0.0
 */
public class ITyrantAction implements Parcelable {

    /**
     * 操作事件的 id
     */
    private int id;

    /**
     * 操作事件文本，如 Button 的标题
     */
    private String text;

    /**
     * 响应事件
     */
    private PendingIntent pendingIntent;

    private String className;

    public ITyrantAction(int id, String text, PendingIntent pendingIntent , String className) {
        this.id = id;
        this.text = text;
        this.pendingIntent = pendingIntent;
        this.className = className;
    }

    public ITyrantAction(Parcel in) {
        id = in.readInt();
        text = in.readString();
        pendingIntent = in.readParcelable(PendingIntent.class.getClassLoader());
        className = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(text);
        dest.writeParcelable(pendingIntent, flags);
        dest.writeString(className);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ITyrantAction> CREATOR = new Creator<ITyrantAction>() {
        @Override
        public ITyrantAction createFromParcel(Parcel in) {
            return new ITyrantAction(in);
        }

        @Override
        public ITyrantAction[] newArray(int size) {
            return new ITyrantAction[size];
        }
    };

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public PendingIntent getPendingIntent() {
        return pendingIntent;
    }

    public void setPendingIntent(PendingIntent pendingIntent) {
        this.pendingIntent = pendingIntent;
    }
}
